package com.entity;

import java.util.ArrayList;

/**
 *
 * @author Alejandro Malaver
 */
public class Host {

    private String hostName;
    private String hostCPU;
    private String cpuVel;
    private String hyperthreading;
    private String coreNumber;
    private String cpuUse;
    private String memory;
    private String swap;
    private String memoryUse;
    private String operativeSistem;
    private String kernel;
    private String hostType;
    private String arch;
    private String ip;
    private String osVersion;
    private ArrayList<Service> serviceList;   
    private ArrayList<ConfigFile> filesList;

    /**
     * Crea una nueva instance de Host.
     *
     * @param hostName nombre del host
     * @param hostCPU tipo de CPU del host.
     * @param cpuVel velocidad de CPU.
     * @param hyperthreading capacidad de hyperthreading.
     * @param coreNumber numero de núcleos de procesador.
     * @param cpuUse uso del procesador en el host.
     * @param memory cantidad de memoria del host.
     * @param swap cantidad de memoria swap del host
     * @param memoryUse uso de memoria en el host
     * @param operativeSistem S.O. del host
     * @param kernel version del kernel del sistema
     * @param hostType tipo de host
     */
    public Host(String hostName, String hostCPU, String cpuVel, String hyperthreading,
            String coreNumber, String cpuUse, String memory, String swap, String memoryUse,
            String operativeSistem, String osVersion, String kernel, String hostType,
            String arch, String ip, ArrayList<Service> serviceList, ArrayList<ConfigFile> fileList) {

        this.hostName = hostName;
        this.hostCPU = hostCPU;
        this.cpuVel = cpuVel;
        this.hyperthreading = hyperthreading;
        this.coreNumber = coreNumber;
        this.cpuUse = cpuUse;
        this.memory = memory;
        this.swap = swap;
        this.memoryUse = memoryUse;
        this.operativeSistem = operativeSistem;
        this.kernel = kernel;
        this.hostType = hostType;
        this.osVersion = osVersion;
        this.arch = arch;
        this.ip = ip;
        this.serviceList=serviceList!=null?serviceList:new ArrayList<Service>();
        this.filesList=fileList!=null?fileList:new ArrayList<ConfigFile>();
    }

    public ArrayList<Service> getServiceList() {
        return serviceList;
    }

    public ArrayList<ConfigFile> getFileList() {
        return filesList;
    }

    public String getCoreNumber() {
        return coreNumber;
    }

    public String getUseOfCPU() {
        return cpuUse;
    }

    public String getCpuVel() {
        return cpuVel;
    }

    public String getHostCPU() {
        return hostCPU;
    }

    public String getHostName() {
        return hostName;
    }

    public String getHostType() {
        return hostType;
    }

    public String getHyperthreading() {
        return hyperthreading;
    }

    public String getKernel() {
        return kernel;
    }

    public String getMemory() {
        return memory;
    }

    public String getMemoryUse() {
        return memoryUse;
    }

    public String getOperativeSistem() {
        return operativeSistem;
    }

    public String getSwap() {
        return swap;
    }

    public String[] getProperties() {
        return new String[]{
                    "Procesador: " + hostCPU,
                    "Vel. Procesador: " + cpuVel,
                    "Hyperthreading: " + getHyperthreading(),
                    "Num Nucleos: " + coreNumber,
                    "Uso CPU: " + cpuUse + "%",
                    "Memoria: " + memory+" MB",
                    "Swap: " + swap+" MB",
                    "Uso Memoria: " + memoryUse + "%",
                    "SO: " + operativeSistem,
                    "Versión SO: " + osVersion,
                    "Arquitectura: " + arch,
                    "Direccion Ip: " + ip
                };
    }
}
